import Vue from 'vue'
import VueRouter from 'vue-router'
import CampusBinhaiView from '../views/CampusBinhaiView.vue'
import CampusChashanView from '../views/CampusChashanView.vue'
import CampusYueqingView from '../views/CampusYueqingView.vue'
import StudentSystemView from '../views/StudentSystemView.vue'
import LoginView from '../views/LoginView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'CampusBinhai',
    component: CampusBinhaiView
  },
  {
    path: '/CampusChashan',
    name: 'CampusChashan',
    component: CampusChashanView
  },
  {
    path: '/CampusYueqing',
    name: 'CampusYueqing',
    component: CampusYueqingView
  },
  {
    path: '/StudentSystem',
    name: 'StudentSystem',
    component: StudentSystemView,
    beforeEnter: (to, from, next) => {
      next();
      setTimeout(() => {
        next('Login');
      }, 1000);
    }
  },
  {
    path: '/Login',
    name: 'Login',
    component: LoginView
  }
]







const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
